package cn.good.service.impl;

import cn.good.dao.IUserDao;
import cn.good.domain.po.User;
import cn.good.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * TODO
 *
 * @Description
 * @Author wkm
 * @Date 2024/11/5
 **/
@Service
public class UserServiceImpl implements IUserService {
    @Autowired
    private IUserDao userDao;
    @Override
    public List<User> queryAllUsers() {
        return userDao.selectAll();
    }

    @Override
    public User queryUserOnly(Integer id) {
        return userDao.selectOnly(id);
    }

    @Override
    public int addUser(User user) {
        return userDao.insertUser(user);
    }

    @Override
    public int removeUser(Integer id) {
        return userDao.deleteById(id);
    }

    @Override
    public int refreshUser(User user) {
        return userDao.updateUserById(user);
    }
}
